<?
  $filename = "themes/".$curtheme."/div_menu.php";
  if (file_exists($filename) )
  {
    include $filename;
    return;
  }
?>


<div class="site_body">
<div class="site_div">

<div class="top_div"></div>

<div class="site_header">
<div class="site_header_in">

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
  <td align="left" valign="top">

    <div class="menu_div">
    <table class="mainmenu" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td class="mainmenu_beg"></td>

<!-- Main menu -->
<?
      foreach ($menu as $page_key => $page_title)
      {
        if ($page_key[0] <> ":")
        {
          $class = ($page_key == $toppage) ? "mainmenu_sel_link" : "mainmenu_link";
          print "<td class=\"mainmenu_item\"><a class=\"{$class}\" href=\"{$page_key}\">{$page_title}</a></td>\n";
        }
      };
?>

      <td class="mainmenu_end"></td>
    </tr>
    </table>
    </div>

    <table class="submenu" border="0" cellpadding="0" cellspacing="0">
    <tr>

<!-- Submenu -->
<?
      $submenu = $menu[":".$toppage];
      if ($submenu)
      {
        foreach ($submenu as $page_key => $page_title)
        {
          $class = ($page_key == $page) ? "submenu_sel_link" : "submenu_link";
          print "<td class=\"submenu_item\"><a class=\"{$class}\" href=\"{$page_key}\">{$page_title}</a></td>\n";
        };
      }
?>

    </tr>
    </table>
  </td>

  <td align="right" valign="top" rowspan="2">

    <div class="menu_div">
    <table class="addmenu" border="0" cellpadding="0" cellspacing="0">
    <tr>

<!-- Logon/Language -->
<?
      $tmp1 = trim(preg_replace('/lang=(\w+)/', '', $args), "&");
      $url1 = $page."?".(($tmp1) ? $tmp1."&" : "");


      if ($hidelogon <> 1) 
      {
        if (!$user) 
        {
          print "<td class=\"addmenu_text\">{$msg["Guest"]}</td>\n";
          print "<td class=\"addmenu_item\"><a class=\"addmenu_link\" href=\"logon\">{$msg["Register"]}</a></td>\n";
        } 
        else 
        {
          print "<td class=\"addmenu_text\">{$user["name"]}</td>\n";
          print "<td class=\"addmenu_item\"><a class=\"addmenu_link\" href=\"{$url1}logoff\">{$msg["Logoff"]}</a></td>\n";
        }
        print "<td>|</td>\n";
      }

      if ($lang == "en") 
      {
        print "<td class=\"addmenu_item\"><a class=\"addmenu_link\" href=\"{$url1}lang=ru\">{$msg["Russian"]}</a></td>\n";
        print "<td class=\"addmenu_selected\">{$msg["English"]}</td>\n";
      } 
      else 
      {
        print "<td class=\"addmenu_selected\">{$msg["Russian"]}</td>\n";
        print "<td class=\"addmenu_item\"><a class=\"addmenu_link\" href=\"{$url1}lang=en\">{$msg["English"]}</a></td>\n";
      }
?>

    </tr>
    </table>
    </div>

    <div class="site_label"> </div>

  </td>
</tr>

<tr>
  <td class="page_title"><?=$PageTitle;?></td>
</tr>

</table>

</div> <!--site_header-->
</div> <!--site_header_in-->

<div class="line_div"></div>

<div class="page_div">
<div class="page_in_div">

